package com.pikaqiu.blog.service.impl;

import com.pikaqiu.blog.dao.UserMapper;
import com.pikaqiu.blog.entity.User;
import com.pikaqiu.blog.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @author 吕梁山
 * @date 2019-01-13
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public int insertUser(User user) {
        user.setCreateDate(new Date());
        user.setUserImg("defult_head_img.jpg");
        return userMapper.insertSelective(user);
    }

    @Override
    public User selectByEmail(String email) {
        return userMapper.selectByEmail(email);
    }
}
